var map = null,
  clickStatus = false;
var sss = 1;
var combinedActionMarkerArr = [];
//var clickButStatus = "normal";//点击筛选按钮得到的状态
var BaiDuMap = {
  /**
   * 初始化地图
   */
  map: function (mapId, obj) {
    map = new BMap.Map(mapId, obj);
  },
  /**
   * 定义点
   * longitude 经度
   * latitude 纬度
   */
  point: function (longitude, latitude) {
    var point = new BMap.Point(longitude, latitude);
    return point;
  },
  /**
   * 创建标注
   * no 编号(唯一)
   * deviceName 设备名称
   * position 安装位置
   */
  addMarker: function (fireCount, status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {

    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    sContent += "<tr><td class='tit'>累计报警次数 : </td><td colspan='2' style='padding-left: 12px;'><span no='" + no + "' class='smokeSeeHistory'>" + fireCount + "</span><span style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' no='" + no + "' class='smokeSeeHistory'>查看历史<span></td></tr>";
    // sContent += "<tr><td></td><td style='float:right;'>查看</td></tr>";
    sContent += "</tbody></table></div></div>";
    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      // 将div 添加到 覆盖物的容器中
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }

    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '1') {

      var myIcon = new BMap.Icon("/public/images/map/alarm.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      // 设置火警图标在上层显示
      marker.setTop(true);
      marker.setZIndex(100);
      //火警光圈向上移动24px
      //$(".active-alarm-pointer").parent().css("top", "-30px");

    } else if (status == '4') {
      var myIcon = new BMap.Icon("/public/images/map/low.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '3') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/map/fault.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      // 设置marker图标大小
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });


    } else if (status == '7') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/map/normal.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/map/fault.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }
    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    // 创建信息窗口对象
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {
      // 地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      // 开启信息窗口
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      // $(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

      $("body .smokeSeeHistory").on("click", smokeSeeHistoryFunc());

    });

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    $('#allPointPosition').on('click', function () {
      showOver();
      devTypeStatus = '';
      //            $(this).parent().siblings().find('.activeToggle').removeClass('active');
      //            $(this).addClass('active');
      // $(this).siblings().find('.activeToggle').removeClass('active');
      // $(this).find('.activeToggle').addClass('active');
    });
    $('#normalPointPosition').on('click', function () {
      showOver();
      if (!(status == "7")) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 7;
    });
    $('#faultPointPosition').on('click', function () {
      showOver();
      if (!(status == "3")) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 3;
    });
    $('#lowPointPosition').on('click', function () {
      showOver();
      if (!(status == "4")) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 4;
    });
    $('#alarmPointPosition').on('click', function () {
      showOver();
      if (!(status == "1")) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 1;
    });
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('.title.earlyWaringRectify-trigger').click(function () {
      hideOver();
    })
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    })
    $('#smokeBtn').on('click', function () {
      showOver();
      // }
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      // $(this).addClass('active').siblings().removeClass('active');
      // $(".pointPositionBox-smoke").hide();
      // $('.pointPositionBox-earlyWarning').show();
      // $('.devAlltoggleBtn-title span').removeClass('active');
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });

    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });


    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 

  }, //addMarker end
  // 三色预警
  earlyWarningAddMarker: function (unit, levelisk, manager, telephone, longitude, latitude, no, position, orgName) {
    var leveliskStr = '';
    if (levelisk == 1) {
      leveliskStr = '一般';
    } else if (levelisk == 2) {
      leveliskStr = '较大';
    } else if (levelisk == 3) {
      leveliskStr = '高危';
    }
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class=''></i>火险等级 : </td><td class='col2-wid colorff4242'>" + leveliskStr + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='earlyWarningSeeDetails' orgid='" + orgid + "' id='" + id + "' data-onlyvalue='" + no + "' onlyvalue='" + no + "' data-qrcode='" + unit + "'>查看详情</td></tr>";
    if ((manager.length != 0) && (telephone.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + manager + "&nbsp;/&nbsp;" + telephone + "</td></tr>";
    }
    sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + unit + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._levelisk = levelisk;
      this.levelisk = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (levelisk == '1') {
      var myIcon = new BMap.Icon("/public/images/earlyWarning/commonlyPoint.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (levelisk == '2') {
      var myIcon = new BMap.Icon("/public/images/earlyWarning/middlePoint.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (levelisk == '3') {
      var myIcon = new BMap.Icon("/public/images/earlyWarning/highPoint.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/earlyWarning/commonlyPoint.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.levelisk = levelisk;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

      $("body .earlyWarningSeeDetails").on("click", earlyWarningSeeDetailsFunc1());
    });

    hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 
    $('#allPointPosition-earlyWarning').on('click', function () {
      showOver();
      $(this).siblings().find('.activeToggle').removeClass('active');
      $(this).find('.activeToggle').addClass('active');
      devTypeStatus = '';
    });
    $('#commonlyPointPosition-earlyWarning').on('click', function () {
      showOver();
      if (!(levelisk == "1")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 1;
    });
    $('#middlePointPosition-earlyWarning').on('click', function () {
      showOver();
      if (!(levelisk == "2")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 2;
    });
    $('#heightPointPosition-earlyWarning').on('click', function () {
      showOver();
      if (!(levelisk == "3")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 3;
    });
    // 定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      showOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end

  // 充电桩
  chargeAddMarker: function (chargingInterfaceNumber, numberOfChargedVehicles, orgName, status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class='fa fa-charge-num1'></i>正在充电数量 : </td><td class='col2-wid' style='padding-left:12px;'>" + numberOfChargedVehicles + "</td> </tr>";//<td style='float:right;margin-left:20px;color:#fff440;'>查看详情</td>
    sContent += "<tr><td class='tit'><i class='fa fa-charge-num2'></i>充电路数 : </td><td class='col2-wid'>" + chargingInterfaceNumber + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    // if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
    //     sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    // }
    // if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
    //     sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    // }
    // if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
    //     sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    // }
    // if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
    //     sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    // }
    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '10') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/charging/green_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '12' || status == '13' || status == '14' || status == '15' || status == '16') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/charging/red_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '17') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/charging/hui_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/charging/hui_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 地图点位筛选
    $('#allPointPosition-charge').on('click', function () {
      showOver();
      devTypeStatus = '';
      // $(this).siblings().find('.activeToggle').removeClass('active');
      // $(this).find('.activeToggle').addClass('active');
    });
    $('#normalPointPosition-charge').on('click', function () {
      showOver();
      if (!(status == "10")) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 10;
    });
    $('#abnormalPointPosition-charge').on('click', function () {
      showOver();
      if (!(status == '12' || status == '13' || status == '14' || status == '15' || status == '16')) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 1213141516;
    });
    $('#faultPointPosition-charge').on('click', function () {
      showOver();
      if (!(status == "17")) {
        map.closeInfoWindow();
        hideOver();
        // $(this).siblings().find('.activeToggle').removeClass('active');
        // $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 17;
    });

    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#chargeBtn').on('click', function () {
      showOver();
      // }
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //chargeAddMarker end
  // 消火栓
  fireplugAddMarker: function (waterGage, orgName, status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>";
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备类型 : </td><td class='col2-wid'>消火栓</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' no='" + no + "' class='fireHydrantSeeDetails'>查看详情</td></tr>";
    // sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>充电路数 : </td><td class='col2-wid'>" + no + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    // if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
    //     sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    // }
    // if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
    //     sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    // }
    // if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
    //     sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    // }
    // if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
    //     sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    // }
    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i><span>所属组织 : </span></td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '30') {
      var myIcon = new BMap.Icon("/public/images/fireplug/green_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '31') {
      var myIcon = new BMap.Icon("/public/images/fireplug/cheng_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '32') {
      var myIcon = new BMap.Icon("/public/images/fireplug/red_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '33') {
      var myIcon = new BMap.Icon("/public/images/fireplug/hui_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/fireplug/hui_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

      // 点击详情
      $("body .fireHydrantSeeDetails").on("click", fireHydrantSeeDetailsFunc1());
    });
    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 地图点位筛选
    $('#allPointPosition-fireplug').on('click', function () {
      showOver();
      devTypeStatus = '';
    });
    $('#normalPointPosition-fireplug').on('click', function () {
      showOver();
      if (!(status == "30")) {

        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 30;
    });
    $('#lowPointPosition-fireplug').on('click', function () {
      showOver();
      if (!(status == "31")) {
        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 31;
    });
    $('#alarmPointPosition-fireplug').on('click', function () {
      showOver();
      if (!(status == '32')) {
        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 32;
    });
    $('#faultPointPosition-fireplug').on('click', function () {
      showOver();
      if (!(status == "33")) {
        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 33;
    });

    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#fireplugBtn').on('click', function () {
      showOver();
      // }
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //fireplugAddMarker end
  // 水位检测
  waterAddMarker: function (status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {

    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    // sContent += "<tr><td class='tit'>累计报警次数 : </td><td colspan='2'>" + fireCount + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '50') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/water/green_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '51') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/water/red_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '52') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/water/hui_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/water/hui_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 地图点位筛选
    $('#allPointPosition-water').on('click', function () {
      showOver();
      $(this).siblings().find('.activeToggle').removeClass('active');
      $(this).find('.activeToggle').addClass('active');
      devTypeStatus = '';
    });
    $('#normalPointPosition-water').on('click', function () {
      showOver();
      if (!(status == "50")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 50;
    });
    $('#abnormalPointPosition-water').on('click', function () {
      showOver();
      if (!(status == '51')) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 51;
    });
    $('#faultPointPosition-water').on('click', function () {
      showOver();
      if (!(status == "52")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 52;
    });

    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#waterBtn').on('click', function () {
      showOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //waterAddMarker end
  // 视频
  videoAddMarker: function (cameraUrl, streamServer, orgName, status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td><td cameraUrl='" + cameraUrl + "' streamServer='" + streamServer + "' devCode='" + no + "' class='vid' style='float:right;margin-left:20px;color:#fff440;'>查看详情</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '60') {
      //  				,{anchor: new BMap.Size(30, 24),infoWindowAnchor: new BMap.Size(30, 20)},offset: new BMap.Size(0, -24)
      var myIcon = new BMap.Icon("/public/images/video/green_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/video/green_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {
      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

      $("body .vid").on("click", videoFunc());
    });

    function videoFunc() {
      $('body .vid').on('click', function () {
        var cameraUrl = $(this).attr('cameraUrl');
        var streamServer = $(this).attr('streamServer');
        var devCode = $(this).attr('devCode');
        event.preventDefault();
        $('.equipmentInfo-pop').addClass('is-visible3');
        $.ajax({
          url: '/deviceStatus/get/code?deviceCode=' + devCode,
          type: 'get',
          success: function (res) {
            var data = res.data[0][0];
            // 填充数据
            $('.equipmentInfo-pop .equipmentInfoDeviceName').val(data.deviceName);
            // 是否启用 1 为启用 0 为不启用
            if (data.usestatus) {
              $('.equipmentInfo-pop .equipmentInfoDevUse').val("启用");
            } else {
              $('.equipmentInfo-pop .equipmentInfoDevUse').val("停用");
            }
            $('.equipmentInfo-pop .equipmentInfoDeviceType').val(data.deviceType.deviceTypeName);
            $('.equipmentInfo-pop .equipmentInfoDevCode').val(data.devCode);
            $('.equipmentInfo-pop .equipmentInfoAddress').val(data.address);
            $('.equipmentInfo-pop .equipmentInfoFixedPlace').val(data.fixedPlace);
            $('.equipmentInfo-pop .equipmentInfoLongitude').val(data.longitude);
            $('.equipmentInfo-pop .equipmentInfoLatitude').val(data.latitude);

            $('.equipmentInfo-pop .equipmentInfoRemark').val(data.remarke);
            $('.equipmentInfo-pop .equipmentInfoOrganization').val(data.organization.orgName);

            // 时间格式转换               
            function equipmentInfoTimeFormat(dateBefore) {
              var dbefore = new Date(dateBefore);
              // var installationDateAfter = dbefore.getFullYear() + '-' + (dbefore.getMonth() + 1) + '-' + dbefore.getDate() + ' ' + dbefore.getHours() + ':' + dbefore.getMinutes() + ':' + dbefore.getSeconds(); 
              var installationDateAfter = dbefore.getFullYear() + '-' + (dbefore.getMonth() + 1) + '-' + dbefore.getDate();
              return installationDateAfter;
            }
            // equipmentInfoTimeFormat(data.installationDate)
            $('.equipmentInfo-pop .equipmentInfoInsDate').val(equipmentInfoTimeFormat(data.installationDate));
            $('.equipmentInfo-pop .equipmentInfoDeadline').val(equipmentInfoTimeFormat(data.deadline));
          },
          error: function () {
            console.log(res);
          }
        });
        // var webRtcServer = new WebRtcStreamer("video", location.protocol + "//172.17.2.25:18000");
        // webRtcServer.connect("rtsp://admin:admin12345@172.16.1.113:554/");
        var webRtcServer = new WebRtcStreamer("video", location.protocol + "//" + cameraUrl);
        webRtcServer.connect(streamServer);
        window.onbeforeunload = function () {
          webRtcServer.disconnect();
        }
        // 关闭窗口
        $('.equipmentInfo-pop .closeModal').on('click', function (event) {
          event.preventDefault();
          $('.equipmentInfo-pop').removeClass('is-visible3');
          webRtcServer.disconnect();
        });
        $('.equipmentInfo-pop').on('click', function (event) {
          if ($(event.target).is('.cd-popup-close') || $(event.target).is('.equipmentInfo-pop')) {
            event.preventDefault();
            $(this).removeClass('is-visible3');
            webRtcServer.disconnect();
          }
        });
      });
    }

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 地图点位筛选
    $('#allPointPosition-video').on('click', function () {
      showOver();
      devTypeStatus = '';
      // $(this).siblings().find('.activeToggle').removeClass('active');
      // $(this).find('.activeToggle').addClass('active');
    });
    $('#normalPointPosition-video').on('click', function () {
      showOver();
      // if (!(status == "10")) {
      //   map.closeInfoWindow();
      //   hideOver();
      // }
      devTypeStatus = 70;
    });


    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#videoBtn').on('click', function () {
      showOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });


    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //videoAddMarker end
  // 智能用电
  electricityAddMarker: function (status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td><td style='float:right;margin-left:20px;color:#fff440;'>查看详情</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    var myIcon = new BMap.Icon("/public/images/electricity/green_1.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
    myIcon.setImageSize(new BMap.Size(21, 26));
    marker = new BMap.Marker(point, {
      icon: myIcon,
      offset: new BMap.Size(0, -24)
    });



    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 地图点位筛选
    $('#allPointPosition-electricity').on('click', function () {
      showOver();
      devTypeStatus = '';
    });
    $('#normalPointPosition-electricity').on('click', function () {
      showOver();
      devTypeStatus = '40';
    });
    $('#lowPointPosition-electricity').on('click', function () {
      showOver();
      if (!(status == "42")) {
        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 42;
    });
    $('#alarmPointPosition-electricity').on('click', function () {
      showOver();
      if (!(status == "43")) {
        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 43;
    });
    $('#faultPointPosition-electricity').on('click', function () {
      showOver();
      if (!(status == "41")) {
        map.closeInfoWindow();
        hideOver();
      }
      devTypeStatus = 41;
    });


    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#electricityBtn').on('click', function () {
      showOver();
      // }
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });


    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //electricityAddMarker end

  // 巡更
  keepAddMarker: function (status, deviceName, no, position, longitude, latitude) {

    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>";
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    // if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
    //   sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    // }
    // if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
    //   sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    // }
    // if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
    //   sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    // }
    // if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
    //   sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    // }
    // sContent += "<tr><td class='tit'>累计报警次数 : </td><td colspan='2'>" + fireCount + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点

    if (status == 'keep') {
      var myIcon = new BMap.Icon("/public/images/keepWatch/keepPoint.png", new BMap.Size(23, 21));
      // myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, 0)
      });
    } else if (status == 'fireStation') {
      var myIcon = new BMap.Icon("/public/images/fireStation/miniFire.png", new BMap.Size(23, 21));
      // myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, 0)
      });
    }

    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "0px")
      $(".BMap_shadow").parent().css("top", "0px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });
    hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // $('#allPointPosition').on('click', function () {
    //   showOver();
    // });
    // $('#normalPointPosition').on('click', function () {
    //   showOver();
    //   if (!(status == "keep")) {
    //     map.closeInfoWindow();
    //     hideOver();
    //   } 
    // });

    $('.title.earlyWaringRectify-trigger').click(function () {
      hideOver();
    });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('#smokeBtn').on('click', function () {
      hideOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      // $(this).addClass('active').siblings().removeClass('active');
      // $(".pointPositionBox-smoke").hide();
      // $('.pointPositionBox-earlyWarning').show();
      // $('.devAlltoggleBtn-title span').removeClass('active');
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      showOver();
    });
    $('#allPointPosition-keep').on('click', function () {
      showOver();
    });
    // 点击微型消防站筛选按钮
    $('#normalPointPosition-fireStation').on('click', function () {
      hideOver();
    });
    // 点击巡更点位筛选按钮
    $('#normalPointPosition-keep').on('click', function () {
      showOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end
  // GPS定位
  GPSAddMarker: function (status, no, deviceName, position, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3, linkMain4, linkPhone4) {

    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    sContent += "</tbody></table></div></div>";
    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点

    var myIcon = new BMap.Icon("/public/images/keepWatch/keepPoint.png", new BMap.Size(23, 21));
    myIcon.setImageSize(new BMap.Size(21, 26));
    marker = new BMap.Marker(point, {
      icon: myIcon,
      offset: new BMap.Size(0, 0)
    });
    // if (status == 'keep') {
    //   var myIcon = new BMap.Icon("/public/images/keepWatch/keepPoint.png", new BMap.Size(23, 21));
    //   marker = new BMap.Marker(point, {
    //     icon: myIcon,
    //     offset: new BMap.Size(0, 0)
    //   });
    // }

    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "0px")
      $(".BMap_shadow").parent().css("top", "0px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });


    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }

    $('.title.earlyWaringRectify-trigger').click(function () {
      hideOver();
    });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('#GPSBtn').on('click', function () {
      showOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      // $(this).addClass('active').siblings().removeClass('active');
      // $(".pointPositionBox-smoke").hide();
      // $('.pointPositionBox-earlyWarning').show();
      // $('.devAlltoggleBtn-title span').removeClass('active');
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });


    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      infoWindow: infoWindow,
      marker: marker
    }
  }, //addMarker end
  // 微型消防站 (id,latitude,longitude,type,orgName,personal,telephone)
  fireStationAddMarker: function (no, longitude, latitude, status, orgName, personal, telephone, photoUrl, parentid) {
    var photoUrlHtml = '';
    // if (photoUrl) {
    //   photoUrlHtml = "<td><img style='width: 60px;height: 60px;border:10px solid #1fadf6;border-radius:10px;' src='" + photoUrl + "' /></td>";
    // }
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>";
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class='fa fa-cube1'></i>设备编号 : </td><td class='col2-wid'>" + no + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i><span>" + orgName + "</span><span style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='fireStationSeeDetails1' orgName='" + orgName + "'>配备</span><span style='float:right;color:#fff440;cursor:pointer;' class='fireStationSeeDetails' no='" + no + "' longitude='" + longitude + "' latitude='" + latitude + "' status='" + status + "' orgName='" + orgName + "' personal='" + personal + "' telephone='" + telephone + "' photoUrl='" + photoUrl + "' parentid='" + parentid + "'>详情</span></td>" + photoUrlHtml + "</tr>";

    if (personal && telephone && (personal.length != 0) && (telephone.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i><span>负责人 : " + personal + "&nbsp;/&nbsp;" + telephone + "</span></td></tr>"; //<td class='col2-wid'>" + personal + "&nbsp;/&nbsp;" + telephone + "</td>
      // sContent += "<tr><td class='tit'></td></tr>";
    }
    sContent += "</tbody></table></div></div>";
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点

    if (status == 'fireStation') {
      var myIcon = new BMap.Icon("/public/images/fireStation/miniFire.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, 3)
      });
    }

    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "0px")
      $(".BMap_shadow").parent().css("top", "0px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

      // 点击详情
      $("body .fireStationSeeDetails").on("click", fireStationSeeDetailsFunc1());

      $("body .fireStationSeeDetails1").on("click", fireStationSeeDetailsFunc2());

    });

    showOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    $('.title.earlyWaringRectify-trigger').click(function () {
      hideOver();
    });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    })
    $('.devBtn').on('click', function () {
      if (localStorage.getItem('loginName') == 'hubin') {
        hideOver();
      } else {
        showOver();
      }
    });
    $('#fireStationBtn').on('click', function () {
      showOver();
    })
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      showOver();
    });
    $('#allPointPosition-keep').on('click', function () {
      showOver();
    });
    // 点击微型消防站筛选按钮
    $('#normalPointPosition-fireStation').on('click', function () {
      showOver();
    });
    // 点击巡更点位筛选按钮
    $('#normalPointPosition-keep').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end
  // 楼长制
  houseMasterAddMarker: function (status, manager, telephone, longitude, latitude, no, position, orgName, houseMasterBuildingName, buildingId, uuid, routingTime, level1, level2, level3, photoUrl, onlyValue) {

    onlyValue = onlyValue ? onlyValue : '';
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class=''></i>火险等级 : </td><td class='col2-wid colorff4242'></td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='houseMasterSeeDetails' orgid='"+orgid+"' id='"+id+"' data-onlyvalue='"+no+"' onlyvalue='"+no+"'>查看详情</td></tr>";
    if (!manager) { //+ "&nbsp;/&nbsp;" + telephone
      manager = '';
    }
    sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>楼长/联系电话 : </td><td class='col2-wid'>" + manager + "</td><td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='houseMasterSeeDetails inspectionDetails-target' buildingName='" + houseMasterBuildingName + "' uuid='" + uuid + "' buildingid='" + buildingId + "' photoUrl='" + photoUrl + "' onlyValue='" + onlyValue + "'>查看详情</td></tr>";

    // sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + unit + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "<tr><td class='tit'><i class='fa'></i>隐患情况 : </td><td colspan='2'><span class='colorff4242'>" + level3 + "</span><span class='colorffb142'>" + level1 + " </span><span class='color61ff42'>" + level2 + "</span></td></tr>";
    sContent += "<tr><td class='tit'><i class='fa'></i>上报时间 : </td><td colspan='2'>" + routingTime + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '1') {
      var myIcon = new BMap.Icon("/public/images/houseMaster/green_1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '2') {
      var myIcon = new BMap.Icon("/public/images/houseMaster/yellow_1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == '3') {
      var myIcon = new BMap.Icon("/public/images/houseMaster/red_1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/houseMaster/green_1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');

      $("body .houseMasterSeeDetails").on("click", houseMasterSeeDetailsFunc1());
    });

    hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 
    $('#allPointPosition-houseMaster').on('click', function () {
      showOver();
      $(this).siblings().find('.activeToggle').removeClass('active');
      $(this).find('.activeToggle').addClass('active');
      devTypeStatus = '';
    });
    $('#commonlyPointPosition-houseMaster').on('click', function () {
      showOver();
      if (!(status == "1")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 1;
    });

    $('#heightPointPosition-houseMaster').on('click', function () {
      showOver();
      if (!(status == "3")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 3;
    });
    $('#middlePointPosition-houseMaster').on('click', function () {
      showOver();
      if (!(status == "2")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 2;
    });
    // // 定位
    // $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
    //   var devicecode = $(this).parent().attr("devcode");
    //   //            hideOver();
    //   if (devicecode == no) {
    //     showOver();
    //   }
    // });
    // $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
    //   var devicecode = $(this).parent().attr("devcode");
    //   console.log(devicecode)
    //   //            hideOver();
    //   if (devicecode == no) {
    //     showOver();
    //   }
    // });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('.devBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      showOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end
  // 高层建筑
  buildingAddMarker: function (buildingName, position, longitude, latitude, orgName, linkMain1, linkPhone1, remark, orNotFireStation, orNotFireLaneIsclear, orNotHighGround, orNotOccupyHighGround, orNotRemoteMonitoring, orNotFireEquipment, orNotMeasures, numberOfFireRoomStaff, no, status, buildingType, photoUrl) {
    // buildingAddMarker: function (numberOfFireRoomStaff,linkMain1,linkPhone1,buildingName,position,latitude,longitude,remark,orNotFireStation,orNotFireLaneIsclear,orNotHighGround,orNotOccupyHighGround,orNotRemoteMonitoring,orNotFireEquipment,orNotMeasures,status,no, gongbushijian,bianhao,mingcheng,dizhi,jingdu,weidu,chengqu,jiedao,fangchan,chanquan,lianxifnagshi,baohudengji,dutuhao,jiegou,mianji,niandai,daleibie,xiaoleibie,yuanshi,xianzhuang,baohu,jiazhidengji,shengwenbaodengji,shijian,shengjishijian,jianjie,beizhu) {

    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"

    // linkMain1='"+linkMain1+"' linkPhone1='"+linkPhone1+"' buildingName='"+buildingName+"' address='"+address+"' longitude='"+longitude+"' latitude='"+latitude+"' remark='"+remark+"' orNotFireStation='"+orNotFireStation+"' orNotFireLaneIsclear='"+orNotFireLaneIsclear+"' orNotHighGround='"+orNotHighGround+"' orNotOccupyHighGround='"+orNotOccupyHighGround+"' orNotRemoteMonitoring='"+orNotRemoteMonitoring+"' orNotFireEquipment='"+orNotFireEquipment+"' orNotMeasures='"+orNotMeasures+"' status='"+status+"' no='"+no+"' 

    if (status == 'building') {
      sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";

      sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + buildingName + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='buildingSeeDetails' devcode='" + no + "' photoUrl='" + photoUrl + "' buildingType='" + buildingType + "' longitude='" + longitude + "' longitude='" + latitude + "' orgName='" + orgName + "' linkMain1='" + linkMain1 + "' linkPhone1='" + linkPhone1 + "' buildingName='" + buildingName + "' address='" + position + "' longitude='" + longitude + "' latitude='" + latitude + "' remark='" + remark + "' orNotFireStation='" + orNotFireStation + "' orNotFireLaneIsclear='" + orNotFireLaneIsclear + "' orNotHighGround='" + orNotHighGround + "' orNotOccupyHighGround='" + orNotOccupyHighGround + "' orNotRemoteMonitoring='" + orNotRemoteMonitoring + "' orNotFireEquipment='" + orNotFireEquipment + "' orNotMeasures='" + orNotMeasures + "' status='" + status + "' no='" + no + "' numberOfFireRoomStaff='" + numberOfFireRoomStaff + "'>查看详情</td></tr>";
      if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
        sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td><td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' buildingName='" + buildingName + "' class='buildingAcceptanceCondition'>验收情况</td></tr>";
      }
      sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

      // sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
      sContent += "</tbody></table></div></div>";
    }
    // else if(status = 'wen'){
    //   sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";

    //   sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + buildingName + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='wenbaoSeeDetails' devcode='"+no+"' latitude='"+latitude+"' linkMain1='"+linkMain1+"' gongbushijian='"+gongbushijian+"' bianhao='"+bianhao+"' mingcheng='"+mingcheng+"' dizhi='"+dizhi+"' chengqu='"+chengqu+"' longitude='"+longitude+"' jiedao='"+jiedao+"' fangchan='"+fangchan+"' chanquan='"+chanquan+"' lianxifnagshi='"+lianxifnagshi+"' baohudengji='"+baohudengji+"' dutuhao='"+dutuhao+"' jiegou='"+jiegou+"' mianji='"+mianji+"' niandai='"+niandai+"' daleibie='"+daleibie+"' xiaoleibie='"+xiaoleibie+"' yuanshi='"+yuanshi+"' xianzhuang='"+xianzhuang+"' baohu='"+baohu+"' jiazhidengji='"+jiazhidengji+"' shengwenbaodengji='"+shengwenbaodengji+"' shijian='"+shijian+"' shengjishijian='"+shengjishijian+"' jianjie='"+jianjie+"' beizhu='"+beizhu+"'>查看详情</td></tr>";
    //   if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
    //     sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    //   }
    //   sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    //   // sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    //   sContent += "</tbody></table></div></div>";
    // }else if(status == 'fang'){
    //   sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";

    //   sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + buildingName + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='buildingSeeDetails' devcode='"+no+"'>查看详情</td></tr>";
    //   if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
    //     sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    //   }
    //   sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    //   // sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    //   sContent += "</tbody></table></div></div>";
    // }

    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == 'building') {
      var myIcon = new BMap.Icon("/public/images/building/gao1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == 'wen') {
      var myIcon = new BMap.Icon("/public/images/building/wen1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == 'fang') {
      var myIcon = new BMap.Icon("/public/images/building/fang1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/building/gao1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');

      $("body .buildingSeeDetails").on("click", buildingSeeDetailsFunc1());
      // $("body .buildingAcceptanceCondition").on("click", buildingAcceptanceConditionFunc());
    });

    hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 
    $('#allPointPosition-building').on('click', function () {
      showOver();
      $(this).siblings().find('.activeToggle').removeClass('active');
      $(this).find('.activeToggle').addClass('active');
      devTypeStatus = '';
    });
    $('#commonlyPointPosition-building').on('click', function () {
      showOver();
      if (!(status == "building")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 1;
    });
    $('#middlePointPosition-building').on('click', function () {
      showOver();
      if (!(status == "wen")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 2;
    });
    $('#heightPointPosition-building').on('click', function () {
      showOver();
      if (!(status == "fang")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 3;
    });
    // // 定位
    // $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
    //   var devicecode = $(this).parent().attr("devcode");
    //   //            hideOver();
    //   if (devicecode == no) {
    //     showOver();
    //   }
    // });
    // $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
    //   var devicecode = $(this).parent().attr("devcode");
    //   console.log(devicecode)
    //   //            hideOver();
    //   if (devicecode == no) {
    //     showOver();
    //   }
    // });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('.devBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      showOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end
  // 文历保
  buildingAddMarker1: function (status, gongbushijian, bianhao, mingcheng, dizhi, longitude, latitude, chengqu, jiedao, fangchan, chanquan, lianxifnagshi, dutuhao, mianji, niandai, jiegou, daleibie, xiaoleibie, yuanshi, xianzhuang, baohu, baohudengji, jianjie, jiazhidengji, shijian, wenwudengji, shengjishijian, beizhu) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"

    // linkMain1='"+linkMain1+"' linkPhone1='"+linkPhone1+"' buildingName='"+buildingName+"' address='"+address+"' longitude='"+longitude+"' latitude='"+latitude+"' remark='"+remark+"' orNotFireStation='"+orNotFireStation+"' orNotFireLaneIsclear='"+orNotFireLaneIsclear+"' orNotHighGround='"+orNotHighGround+"' orNotOccupyHighGround='"+orNotOccupyHighGround+"' orNotRemoteMonitoring='"+orNotRemoteMonitoring+"' orNotFireEquipment='"+orNotFireEquipment+"' orNotMeasures='"+orNotMeasures+"' status='"+status+"' no='"+no+"' 

    // if(status == 'building'){
    //   sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";

    //   sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + buildingName + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='buildingSeeDetails' devcode='"+no+"' longitude='"+longitude+"' longitude='"+latitude+"' linkMain1='"+linkMain1+"' linkPhone1='"+linkPhone1+"' buildingName='"+buildingName+"' address='"+position+"' longitude='"+longitude+"' latitude='"+latitude+"' remark='"+remark+"' orNotFireStation='"+orNotFireStation+"' orNotFireLaneIsclear='"+orNotFireLaneIsclear+"' orNotHighGround='"+orNotHighGround+"' orNotOccupyHighGround='"+orNotOccupyHighGround+"' orNotRemoteMonitoring='"+orNotRemoteMonitoring+"' orNotFireEquipment='"+orNotFireEquipment+"' orNotMeasures='"+orNotMeasures+"' status='"+status+"' no='"+no+"' numberOfFireRoomStaff='"+numberOfFireRoomStaff+"'>查看详情</td></tr>";
    //   if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
    //     sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    //   }
    //   sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    //   // sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    //   sContent += "</tbody></table></div></div>";
    // }else 
    if (status = 'wen') {
      sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";

      sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + mingcheng + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='wenbaoSeeDetails' devcode='" + bianhao + "' shengwenbaodengji='" + wenwudengji + "' latitude='" + latitude + "' lianxifnagshi='" + lianxifnagshi + "' gongbushijian='" + gongbushijian + "' bianhao='" + bianhao + "' mingcheng='" + mingcheng + "' dizhi='" + dizhi + "' chengqu='" + chengqu + "' longitude='" + longitude + "' jiedao='" + jiedao + "' fangchan='" + fangchan + "' chanquan='" + chanquan + "' lianxifnagshi='" + lianxifnagshi + "' baohudengji='" + baohudengji + "' dutuhao='" + dutuhao + "' jiegou='" + jiegou + "' mianji='" + mianji + "' niandai='" + niandai + "' daleibie='" + daleibie + "' xiaoleibie='" + xiaoleibie + "' yuanshi='" + yuanshi + "' xianzhuang='" + xianzhuang + "' baohu='" + baohu + "' jiazhidengji='" + jiazhidengji + "' shijian='" + shijian + "' shengjishijian='" + shengjishijian + "' jianjie='" + jianjie + "' beizhu='" + beizhu + "'>查看详情</td></tr>";
      // if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      // sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
      // }
      sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + dizhi + "</td></tr>";

      // sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
      sContent += "</tbody></table></div></div>";
    } else if (status == 'fang') {
      sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";

      sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + buildingName + "</td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='buildingSeeDetails' devcode='" + no + "'>查看详情</td></tr>";
      if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
        sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>负责人/联系电话 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
      }
      sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

      // sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
      sContent += "</tbody></table></div></div>";
    }

    //  	  	var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = bianhao;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == 'building') {
      var myIcon = new BMap.Icon("/public/images/building/gao1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == 'wen') {
      var myIcon = new BMap.Icon("/public/images/building/wen1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else if (status == 'fang') {
      var myIcon = new BMap.Icon("/public/images/building/fang1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    } else {
      var myIcon = new BMap.Icon("/public/images/building/gao1.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }


    marker.bianhao = bianhao;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象


    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');

      $("body .buildingSeeDetails").on("click", buildingSeeDetailsFunc1());
    });
    hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }
    // 
    $('#allPointPosition-building').on('click', function () {
      showOver();
      $(this).siblings().find('.activeToggle').removeClass('active');
      $(this).find('.activeToggle').addClass('active');
      devTypeStatus = '';
    });
    $('#commonlyPointPosition-building').on('click', function () {
      showOver();
      if (!(status == "building")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 1;
    });
    $('#middlePointPosition-building').on('click', function () {
      showOver();
      if (!(status == "fang")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 2;
    });
    $('#heightPointPosition-building').on('click', function () {
      showOver();
      if (!(status == "wen")) {
        map.closeInfoWindow();
        hideOver();
        $(this).siblings().find('.activeToggle').removeClass('active');
        $(this).find('.activeToggle').addClass('active');
      }
      devTypeStatus = 3;
    });
    // // 定位
    // $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
    //   var devicecode = $(this).parent().attr("devcode");
    //   //            hideOver();
    //   if (devicecode == no) {
    //     showOver();
    //   }
    // });
    // $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
    //   var devicecode = $(this).parent().attr("devcode");
    //   console.log(devicecode)
    //   //            hideOver();
    //   if (devicecode == no) {
    //     showOver();
    //   }
    // });
    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('.devBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      showOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: bianhao,
      marker: marker
    }
  }, //addMarker end
  // 协同作战
  combinedActionAddMarker0: function (status, offsetStr, distance, combinedActionMan, combinedActionAddress, combinedActionNum, combinedActionPhone, manager, telephone, longitude, latitude, no, position, orgName, combinedActionBuildingName) {
    
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class=''></i>火险等级 : </td><td class='col2-wid colorff4242'></td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='combinedActionSeeDetails' orgid='"+orgid+"' id='"+id+"' data-onlyvalue='"+no+"' onlyvalue='"+no+"'>查看详情</td></tr>";
    if ((manager.length != 0) && (telephone.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>楼长/联系电话 : </td><td class='col2-wid'>" + manager + "&nbsp;/&nbsp;" + telephone + "<td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='combinedActionSeeDetails' buildingName='" + combinedActionBuildingName + "'>查看详情</td></td></tr>";
    }
    // sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + unit + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "<tr><td class='tit'><i class='fa'></i>隐患情况 : </td><td colspan='2'>紧急(1) 暂缓(2)</td></tr>";
    sContent += "<tr><td class='tit'><i class='fa'></i>上报时间 : </td><td colspan='2'>2018/08.08</td></tr>";
    sContent += "</tbody></table></div></div>";

    function addGroundOverlay() {
      // 添加GroundOverlay
      map.addOverlay(groundOverlay);
      // map.addOverlay(marker3);
    }

    function removeGroundOverlay() {
      // 移除GroundOverlay
      map.removeOverlay(groundOverlay);
      //  map.removeOverlay(marker3);
    }

    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
      var activeStyleDiv = "<div class='dot'></div>" +
        "<div class='pulse pulseTop22'></div>" +
        "<div class='pulse1 pulseTop22'></div>";
      div.innerHTML = activeStyleDiv;
      //		        setTop(isTop: true)

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;
    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 200 + 'px';
      this._div.style.top = pixel.y - 10 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    // 设置label
    // var opts = {
    //   position: point, // 指定文本标注所在的地理位置
    //   offset: new BMap.Size(-15, -65) //设置文本偏移量
    // }
    // var label = new BMap.Label('<p style="font-size:12px;color:red;line-height:12px;letter-spacing:0;margin:0;">地址:' + combinedActionAddress + '</p><p style="font-size:12px;color:red;line-height:12px;letter-spacing:0;margin:0;">联系人:' + combinedActionMan + '</p>', opts); // 创建文本标注对象

    if (status == 'fireHydrant') {

      // 设置label
      var opts = {
        position: point, // 指定文本标注所在的地理位置
        offset: new BMap.Size(-15, -55) //设置文本偏移量
      }
      var label = new BMap.Label(combinedActionAddress + '<p style="height:1px;margin: -4px;"></p>', opts); // 创建文本标注对象

      label.setStyle({
        color: "#ff3600",
        fontSize: "12px",
        height: "12px",
        lineHeight: "12px",
        fontFamily: "微软雅黑",
        padding: "15px 150px 33px -1px",
        border: 'none',
        backgroundColor: 'RGB(33,90,140)',
        // backgroundColor: 'RGB(255,255,255,0)',
        borderRadius: '4px',
        // transformOriginX: 0,
        transform: 'scale(0.8)'
      });
    } else {
      // 设置label
      var opts = {
        position: point, // 指定文本标注所在的地理位置
        offset: new BMap.Size(-15, -70) //设置文本偏移量
      }
      var label = new BMap.Label('地址:' + combinedActionAddress + '<p style="height:1px;margin: -4px;"></p>联系人:' + combinedActionMan, opts); // 创建文本标注对象

      label.setStyle({
        color: "#4ffffd",
        fontSize: "12px",
        height: "20px",
        lineHeight: "20px",
        fontFamily: "微软雅黑",
        padding: "5px 150px 33px -1px",
        border: 'none',
        backgroundColor: 'RGB(33,90,140)',
        // backgroundColor: 'RGB(255,255,255,0)',
        borderRadius: '4px',
        // transformOriginX: 0,
        transform: 'scale(0.8)'
      });
    }


    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '1') {
      // 西南角和东北角
      var SW = new BMap.Point(longitude - 0.01, latitude - 0.01);
      var NE = new BMap.Point(longitude + 0.01, latitude + 0.009);
      // if (groundOverlay) {

      map.removeOverlay(groundOverlay);
      // }
      groundOverlayOptions = {
        opacity: 1,
        // displayOnMinLevel: 10,
        // displayOnMaxLevel: 14
      }

      // 初始化GroundOverlay
      var groundOverlay = new BMap.GroundOverlay(new BMap.Bounds(SW, NE), groundOverlayOptions);

      // 设置GroundOverlay的图片地址
      groundOverlay.setImageURL('/public/images/combinedAction/ycan.png');
      map.addOverlay(groundOverlay);

      var myIcon = new BMap.Icon("/public/images/combinedAction/fire.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(5, -14)
      });
      marker.setTop(true);
      marker.setZIndex(10000);
    } else if (status == 'fireHydrant') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/fireHydrant.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
      // var marker2 = new ComplexCustomOverlay(point);
      // marker2.no = no;
      // marker2.status = status;
      // map.addOverlay(marker2); 
    } else if (status == 'policeCooperation') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/policeCooperation.png", new BMap.Size(35, 30));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
    } else if (status == 'communityCooperation') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/communityCooperation.png", new BMap.Size(35, 30));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
    } else if (status == 'socialCooperation') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/socialCooperation.png", new BMap.Size(35, 30));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 100,
        width: 200
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {
      for (var i = 0; i < combinedActionMarkerArr.length; i++) {
        if (combinedActionMarkerArr[i] == no) {
          combinedActionMarkerArr.splice(i, 1);
        }
      }
      combinedActionMarkerArr.push(no);
      // this.hide();
      map.removeOverlay(this);
      map.removeOverlay(label);
      map.removeOverlay(groundOverlay);
      combinedActionMarker.push(BaiDuMap.combinedActionAddMarker00(status, offsetStr, distance, combinedActionMan, combinedActionAddress, combinedActionNum, combinedActionPhone, manager, telephone, longitude, latitude, no, position, orgName, combinedActionBuildingName));

    });

    // 信息窗口
    // combinedActionMan,combinedActionAddress,combinedActionNum,combinedActionPhone
    // labelStyleFun();
    function labelStyleFun() {
      var labelStyle = {
        color: "#fff",
        // backgroundColor: "#245e90",
        border: "0",
        fontSize: "14px",
        width: "200px",
        height: '100px',
        opacity: "0.8",
        // verticalAlign:"center",
        borderRadius: "2px",
        // whiteSpace:"normal",
        // wordWrap:"break-word",
        // padding:"20px 222px 120px 20px",
      };
      var spanLineLeft1 = '<span style="width: 73px;height: 1px;display: block;background-color: #245e90;position: absolute;top: 50%;left: -73px;"></span>';
      var spanLineRight1 = '<span style="width: 73px;height: 1px;display: block;background-color: #245e90;position: absolute;top: 50%;left: 240px;"></span>';
      // 社警协同点
      // <div style="width:100%;height:100%;background:url(/public/images/combinedAction/di2.png) no-repeat"></div>
      if (status == 'policeCooperation') {
        labelStyle.padding = "0 242px 135px 0";
        // right
        if (offsetStr == 'right') {
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:153px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社警协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">协同点地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'left') {
          // left
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:153px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社警协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">协同点地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        }


      } else if (status == 'communityCooperation') {
        // 社群协同点
        labelStyle.padding = "0 242px 95px 0";
        if (offsetStr == 'right') {
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:95px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社群协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'left') {
          // left
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:95px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社群协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p></div>', labelStyle, offsetStr));
        }
      } else if (status == 'socialCooperation') {
        // 社企协同点
        labelStyle.padding = "0 242px 135px 0";
        if (offsetStr == 'right') {
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:135px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社企协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'left') {
          // left
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:135px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社企协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        }
      } else if (status == 'fireHydrant') {
        // 消火栓
        labelStyle.padding = "0 242px 100px 0";
        if (offsetStr == 'left') {
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:100px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di1.png) no-repeat;background-size: cover;"><p style="font-size: 14px;">消火栓地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">距离报警点:' + distance + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'right') {
          // left
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:100px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di1.png) no-repeat;background-size: cover;"><p style="font-size: 14px;">消火栓地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">距离报警点:' + distance + '</p></div>', labelStyle, offsetStr));
        }
      }

    }


    // hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }

    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    })
    $('.devBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('.combinedActionBtn').on('click', function () {
      showOver();
      map.removeOverlay(groundOverlay);
      map.removeOverlay(label);
      // addGroundOverlay();
      // labelStyleFun();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
      map.removeOverlay(groundOverlay);
      map.removeOverlay(label);
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end
  combinedActionAddMarker00: function (status, offsetStr, distance, combinedActionMan, combinedActionAddress, combinedActionNum, combinedActionPhone, manager, telephone, longitude, latitude, no, position, orgName, combinedActionBuildingName) {
    
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    // sContent += "<tr><td class='tit'><i class=''></i>火险等级 : </td><td class='col2-wid colorff4242'></td> <td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='combinedActionSeeDetails' orgid='"+orgid+"' id='"+id+"' data-onlyvalue='"+no+"' onlyvalue='"+no+"'>查看详情</td></tr>";
    if ((manager.length != 0) && (telephone.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>楼长/联系电话 : </td><td class='col2-wid'>" + manager + "&nbsp;/&nbsp;" + telephone + "<td style='float:right;margin-left:20px;color:#fff440;cursor:pointer;' class='combinedActionSeeDetails' buildingName='" + combinedActionBuildingName + "'>查看详情</td></td></tr>";
    }
    // sContent += "<tr><td class='tit'><i class='fa-map-unit'></i>单位名称 : </td><td class='col2-wid'>" + unit + "</td> </tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";

    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "<tr><td class='tit'><i class='fa'></i>隐患情况 : </td><td colspan='2'>紧急(1) 暂缓(2)</td></tr>";
    sContent += "<tr><td class='tit'><i class='fa'></i>上报时间 : </td><td colspan='2'>2018/08.08</td></tr>";
    sContent += "</tbody></table></div></div>";

    function addGroundOverlay() {
      // 添加GroundOverlay
      map.addOverlay(groundOverlay);
      // map.addOverlay(marker3);
    }

    function removeGroundOverlay() {
      // 移除GroundOverlay
      map.removeOverlay(groundOverlay);
      //  map.removeOverlay(marker3);
    }

    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
      var activeStyleDiv = "<div class='dot'></div>" +
        "<div class='pulse pulseTop22'></div>" +
        "<div class='pulse1 pulseTop22'></div>";
      div.innerHTML = activeStyleDiv;
      //		        setTop(isTop: true)

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;
    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 200 + 'px';
      this._div.style.top = pixel.y - 10 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }

    if (status == 'fireHydrant') {

      // 设置label
      var opts = {
        position: point, // 指定文本标注所在的地理位置
        offset: new BMap.Size(-15, -55) //设置文本偏移量
      }
      var label = new BMap.Label(combinedActionAddress + '<p style="height:1px;margin: -4px;"></p>', opts); // 创建文本标注对象

      label.setStyle({
        color: "#ff3600",
        fontSize: "12px",
        height: "12px",
        lineHeight: "12px",
        fontFamily: "微软雅黑",
        padding: "15px 150px 33px -1px",
        border: 'none',
        backgroundColor: 'RGB(33,90,140)',
        // backgroundColor: 'RGB(255,255,255,0)',
        borderRadius: '4px',
        // transformOriginX: 0,
        transform: 'scale(0.8)'
      });
    } else {
      // 设置label
      var opts = {
        position: point, // 指定文本标注所在的地理位置
        offset: new BMap.Size(-15, -70) //设置文本偏移量
      }
      var label = new BMap.Label('地址:' + combinedActionAddress + '<p style="height:1px;margin: -4px;"></p>联系人:' + combinedActionMan, opts); // 创建文本标注对象

      label.setStyle({
        color: "#4ffffd",
        fontSize: "12px",
        height: "20px",
        lineHeight: "20px",
        fontFamily: "微软雅黑",
        padding: "5px 150px 33px -1px",
        border: 'none',
        backgroundColor: 'RGB(33,90,140)',
        // backgroundColor: 'RGB(255,255,255,0)',
        borderRadius: '4px',
        // transformOriginX: 0,
        transform: 'scale(0.8)'
      });
    }

    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    if (status == '1') {
      // 西南角和东北角
      var SW = new BMap.Point(longitude - 0.01, latitude - 0.01);
      var NE = new BMap.Point(longitude + 0.01, latitude + 0.009);
      // if (groundOverlay) {

      map.removeOverlay(groundOverlay);
      // }
      groundOverlayOptions = {
        opacity: 1,
        // displayOnMinLevel: 10,
        // displayOnMaxLevel: 14
      }

      // 初始化GroundOverlay
      var groundOverlay = new BMap.GroundOverlay(new BMap.Bounds(SW, NE), groundOverlayOptions);

      // 设置GroundOverlay的图片地址
      groundOverlay.setImageURL('/public/images/combinedAction/ycan.png');
      map.addOverlay(groundOverlay);

      var myIcon = new BMap.Icon("/public/images/combinedAction/fire.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(5, -14)
      });
    } else if (status == 'fireHydrant') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/fireHydrant.png", new BMap.Size(21, 26));
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
      // var marker2 = new ComplexCustomOverlay(point);
      // marker2.no = no;
      // marker2.status = status;
      // map.addOverlay(marker2);
    } else if (status == 'policeCooperation') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/policeCooperation1.png", new BMap.Size(35, 30));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
    } else if (status == 'communityCooperation') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/communityCooperation1.png", new BMap.Size(35, 30));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
    } else if (status == 'socialCooperation') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/socialCooperation1.png", new BMap.Size(35, 30));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      map.addOverlay(label);
    }


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 100,
        width: 200
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {
      for (var i = 0; i < combinedActionMarkerArr.length; i++) {
        if (combinedActionMarkerArr[i] == no) {
          combinedActionMarkerArr.splice(i, 1);
        }
      }
      // this.hide();
      map.removeOverlay(this);
      map.removeOverlay(label);
      map.removeOverlay(groundOverlay);
      combinedActionMarker.push(BaiDuMap.combinedActionAddMarker0(status, offsetStr, distance, combinedActionMan, combinedActionAddress, combinedActionNum, combinedActionPhone, manager, telephone, longitude, latitude, no, position, orgName, combinedActionBuildingName));

    });

    // 信息窗口
    // combinedActionMan,combinedActionAddress,combinedActionNum,combinedActionPhone
    // labelStyleFun();
    function labelStyleFun() {
      var labelStyle = {
        color: "#fff",
        // backgroundColor: "#245e90",
        border: "0",
        fontSize: "14px",
        width: "200px",
        height: '100px',
        opacity: "0.8",
        // verticalAlign:"center",
        borderRadius: "2px",
        // whiteSpace:"normal",
        // wordWrap:"break-word",
        // padding:"20px 222px 120px 20px",
      };
      var spanLineLeft1 = '<span style="width: 73px;height: 1px;display: block;background-color: #245e90;position: absolute;top: 50%;left: -73px;"></span>';
      var spanLineRight1 = '<span style="width: 73px;height: 1px;display: block;background-color: #245e90;position: absolute;top: 50%;left: 240px;"></span>';
      // 社警协同点
      // <div style="width:100%;height:100%;background:url(/public/images/combinedAction/di2.png) no-repeat"></div>
      if (status == 'policeCooperation') {
        labelStyle.padding = "0 242px 135px 0";
        // right
        if (offsetStr == 'right') {
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:153px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社警协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">协同点地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'left') {
          // left
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:153px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社警协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">协同点地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        }


      } else if (status == 'communityCooperation') {
        // 社群协同点
        labelStyle.padding = "0 242px 95px 0";
        if (offsetStr == 'right') {
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:95px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社群协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'left') {
          // left
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:95px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社群协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p></div>', labelStyle, offsetStr));
        }
      } else if (status == 'socialCooperation') {
        // 社企协同点
        labelStyle.padding = "0 242px 135px 0";
        if (offsetStr == 'right') {
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:135px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社企协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'left') {
          // left
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:135px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di2.png) no-repeat;background-size: cover;"><p style="font-size: 16px;">社企协同点(' + distance + 'm)</p><p style="font-size: 14px;">协同点联系人:' + combinedActionMan + '</p><p style="font-size: 14px;">联系电话:' + combinedActionPhone + '</p><p style="font-size: 14px;">可协同数量:' + combinedActionNum + '</p></div>', labelStyle, offsetStr));
        }
      } else if (status == 'fireHydrant') {
        // 消火栓
        labelStyle.padding = "0 242px 100px 0";
        if (offsetStr == 'left') {
          marker.setLabel(setLabelStyle(spanLineRight1 + '<div style="width:242px;height:100px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di1.png) no-repeat;background-size: cover;"><p style="font-size: 14px;">消火栓地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">距离报警点:' + distance + '</p></div>', labelStyle, offsetStr));
        } else if (offsetStr == 'right') {
          // left
          marker.setLabel(setLabelStyle(spanLineLeft1 + '<div style="width:242px;height:100px;padding:15px 0 0 20px;background:url(/public/images/combinedAction/di1.png) no-repeat;background-size: cover;"><p style="font-size: 14px;">消火栓地址:' + combinedActionAddress + '</p><p style="font-size: 14px;">距离报警点:' + distance + '</p></div>', labelStyle, offsetStr));
        }
      }

    }


    // hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }

    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    })
    $('.devBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('.combinedActionBtn').on('click', function () {
      showOver();
      map.removeOverlay(groundOverlay);
      map.removeOverlay(label);
      // addGroundOverlay();
      // labelStyleFun();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
      removeGroundOverlay();
      map.removeOverlay(label);
      // removePoint();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end

  combinedActionAddMarker: function (no, typeName, linkMain1, linkPhone1, position, longitude, latitude, Political, status) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class=''></i>" + typeName + "</td></tr>";
    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>联系人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + position + "</td></tr>";
    if (Political) {
      sContent += "<tr><td class='tit' ><i class='fa zhengzhi'></i>政治面貌：</td><td colspan='2'>" + Political + "</td></tr>";
    }

    sContent += "</tbody></table></div></div>";

    function addGroundOverlay() {
      // 添加GroundOverlay
      map.addOverlay(groundOverlay);
      // map.addOverlay(marker3);
    }

    function removeGroundOverlay() {
      // 移除GroundOverlay
      map.removeOverlay(groundOverlay);
      //  map.removeOverlay(marker3);
    }

    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
      var activeStyleDiv = "<div class='dot'></div>" +
        "<div class='pulse pulseTop22'></div>" +
        "<div class='pulse1 pulseTop22'></div>";
      div.innerHTML = activeStyleDiv;
      //		        setTop(isTop: true)

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;
    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    // 设置label
    // var opts = {
    //   position: point, // 指定文本标注所在的地理位置
    //   offset: new BMap.Size(-15, -65) //设置文本偏移量
    // }
    // var label = new BMap.Label('<p style="font-size:12px;color:red;line-height:12px;letter-spacing:0;margin:0;">地址:' + combinedActionAddress + '</p><p style="font-size:12px;color:red;line-height:12px;letter-spacing:0;margin:0;">联系人:' + combinedActionMan + '</p>', opts); // 创建文本标注对象

    // policeCooperation,communityCooperation,socialCooperation,socialCooperation1

    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    // 社警
    if (status == 'police') {
      var myIcon = new BMap.Icon("/public/images/combinedAction/police.png", new BMap.Size(20, 23));
      myIcon.setImageSize(new BMap.Size(20, 23));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      marker.setTop(true);
      marker.setZIndex(10000);
    } else if (status == 'community') {
      // 社群
      var myIcon = new BMap.Icon("/public/images/combinedAction/community.png", new BMap.Size(26, 21));
      myIcon.setImageSize(new BMap.Size(26, 21));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      marker.setTop(true);
      marker.setZIndex(10000);
    } else if (status == 'social') {
      // 社企
      var myIcon = new BMap.Icon("/public/images/combinedAction/social.png", new BMap.Size(20, 23));
      myIcon.setImageSize(new BMap.Size(20, 23));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      marker.setTop(true);
      marker.setZIndex(10000);
    } else if (status == 'community1') {
      // 
      var myIcon = new BMap.Icon("/public/images/combinedAction/community1.png", new BMap.Size(31, 27));
      myIcon.setImageSize(new BMap.Size(31, 27));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
      marker.setTop(true);
      marker.setZIndex(10000);
    } else {
      var myIcon = new BMap.Icon("/public/images/combinedAction/police.png", new BMap.Size(20, 23));
      myIcon.setImageSize(new BMap.Size(20, 23));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
    }

    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    // 创建信息窗口对象
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-26px");
      $(".BMap_shadow").parent().css("top", "-26px");
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');

    });
    hideOver();

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }

    // 点击设备按钮筛选
    $('#allDevBtn').on('click', function () {
      hideOver();
    })
    $('.devBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      showOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      showOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
  }, //addMarker end

  // 岗亭
  sentryBoxAddMarker: function (orgName, no, deviceName, address, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>名称：</td><td colspan='2'>" + deviceName + "</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fafa fa-map-marker1'></i>地址：</td><td colspan='2'>" + address + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>联系人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    var myIcon = new BMap.Icon("/infoManage/image/sentryBox.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
    myIcon.setImageSize(new BMap.Size(21, 26));
    marker = new BMap.Marker(point, {
      icon: myIcon,
      offset: new BMap.Size(0, -24)
    });


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }


    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#sentryBoxBtn').on('click', function () {
      showOver();
      // }
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //sentryBoxAddMarker end
  // 终端apk
  apkAddMarker: function (orgName, no, deviceName, address, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>名称：</td><td colspan='2'>" + deviceName + "</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + address + "</td></tr>";

    if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>联系人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
    }
    if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
    }
    if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
    }
    if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
      sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
    }
    sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    var myIcon = new BMap.Icon("/infoManage/image/apk.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
    myIcon.setImageSize(new BMap.Size(21, 26));
    marker = new BMap.Marker(point, {
      icon: myIcon,
      offset: new BMap.Size(0, -24)
    });


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }


    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#apkBtn').on('click', function () {
      showOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //apkAddMarker end
    // 手报
    shoubaoAddMarker: function (orgName, no, deviceName, address, longitude, latitude, linkMain1, linkPhone1, linkMain2, linkPhone2, linkMain3, linkPhone3) {
      var point = new BMap.Point(longitude, latitude);
      // 拼接html字符串
      var sContent = "<div>"
      sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
      sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>名称：</td><td colspan='2'>" + deviceName + "</td></tr>";
      sContent += "<tr><td class='tit' ><i class='fa fa-map-marker1'></i>地址：</td><td colspan='2'>" + address + "</td></tr>";
  
      if ((linkMain1.length != 0) && (linkPhone1.length != 0)) {
        sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>联系人 : </td><td class='col2-wid'>" + linkMain1 + "&nbsp;/&nbsp;" + linkPhone1 + "</td></tr>";
      }
      if ((linkMain2.length != 0) && (linkPhone2.length != 0)) {
        sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain2 + "&nbsp;/&nbsp;" + linkPhone2 + "</td></tr>";
      }
      if ((linkMain3.length != 0) && (linkPhone3.length != 0)) {
        sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain3 + "&nbsp;/&nbsp;" + linkPhone3 + "</td></tr>";
      }
      if ((linkMain4.length != 0) && (linkPhone4.length != 0)) {
        sContent += "<tr><td class='tit'></td><td class='col2-wid'>" + linkMain4 + "&nbsp;/&nbsp;" + linkPhone4 + "</td></tr>";
      }
      sContent += "<tr><td class='tit'><i class='fa fa-charge-address2'></i>所属组织 : </td><td colspan='2'>" + orgName + "</td></tr>";
      sContent += "</tbody></table></div></div>";
      // var sContent = '<div>skksks</div>';
      // 自定义覆盖物
      function ComplexCustomOverlay(point) {
        this._point = point;
        this._no = no;
        this.no = null;
        this._status = status;
        this.status = null;
      }
  
      ComplexCustomOverlay.prototype = new BMap.Overlay();
      ComplexCustomOverlay.prototype.initialize = function (map) {
        this._map = map;
        var div = this._div = document.createElement("div");
        div.className = "active-alarm-pointer";
        div.style.position = "absolute";
        div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);
  
        div.onmouseover = function () {
          //
        }
  
        div.onmouseout = function () {
          //
        }
        map.getPanes().labelPane.appendChild(div);
        div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
        return div;
  
      }
      ComplexCustomOverlay.prototype.draw = function () {
        var map = this._map;
        var pixel = map.pointToOverlayPixel(this._point);
        this._div.style.left = pixel.x - 40 - 8 + 'px';
        this._div.style.top = pixel.y - 40 + 20 + 'px';
      }
  
      ComplexCustomOverlay.prototype.getPosition = function () {
        return this._point;
      }
  
      //4、自定义覆盖物添加事件方法
      ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
        this._div['on' + event] = fun;
      }
      var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
      var myIcon = new BMap.Icon("/public/images/shoubao/shoubao.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
      myIcon.setImageSize(new BMap.Size(21, 26));
      marker = new BMap.Marker(point, {
        icon: myIcon,
        offset: new BMap.Size(0, -24)
      });
  
  
      marker.no = no;
      marker.status = status;
      map.addOverlay(marker);
      var infoWindow = new BMap.InfoWindow(sContent, {
        offset: {
          height: 0,
          width: -15
        }
      }, {
        setZIndex: 99
      }); // 创建信息窗口对象
      //  			 markerNormalmHide()
      //5、 为自定义覆盖物添加点击事件
  
      marker.addEventListener('click', function (e) {
  
        //  			        地图信息框显示
        $('.BMap_pop').parent().show();
        $(".BMap_shadow").parent().show();
        map.openInfoWindow(infoWindow, point);
  
        $(".BMap_pop").parent().css("top", "-24px")
        $(".BMap_shadow").parent().css("top", "-24px")
        $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
        //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');
  
      });
  
      if (localStorage.getItem('loginName') == 'hbjd') {
        hideOver();
      }
  
      function showOver() {
        marker.show();
      }
  
      //			覆盖物隐藏
      function hideOver() {
        marker.hide();
      }
  
  
      // 其他模态框定位
      $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
        var devicecode = $(this).parent().attr("devcode");
        //            hideOver();
        if (devicecode == no) {
          showOver();
        }
      });
      $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
        var devicecode = $(this).parent().attr("devcode");
        if (devicecode == no) {
          showOver();
        }
      });
  
  
      $('.title.earlyWaringRectify-trigger').click(function () {
        hideOver();
      })
      // 点击设备按钮筛选
      $('#allDevBtn').on('click', function () {
        showOver();
      })
      $('#shoubaoBtn').on('click', function () {
        showOver();
        // }
      }).siblings('.devBtn').on('click', function () {
        hideOver();
      });
      $('#earlyWarningBtn').on('click', function () {
        // $(this).addClass('active').siblings().removeClass('active');
        // $(".pointPositionBox-smoke").hide();
        // $('.pointPositionBox-earlyWarning').show();
        // $('.devAlltoggleBtn-title span').removeClass('active');
        hideOver();
      });
      $('#wallDoorBtn').on('click', function () {
        hideOver();
      });
      $('#fireStationBtn').on('click', function () {
        hideOver();
      });
      $('#houseMasterBtn').on('click', function () {
        hideOver();
      });
      $('.combinedActionBtn').on('click', function () {
        hideOver();
      });
      // 协同作战地图点位显示
      $('#combinedActionBtn').on('click', function () {
        hideOver();
      });
  
      $('#buildingBtn').on('click', function () {
        hideOver();
      });
      $('#wenbaoBtn').on('click', function () {
        hideOver();
      });
      $('#keepWatchBtn').on('click', function () {
        hideOver();
      });

      function removePoint() {
        map.removeOverlay(marker);
      }
      return {
        showOver: showOver,
        hideOver: hideOver,
        removePoint: removePoint,
        status: status,
        devCode: no,
        marker: marker
      }
      // 
    }, //手报 end
  // 重点人员
  keyPersonAddMarker: function (name,age, no, personnelType, address, latitude, longitude, telephone, emergencyPeople, emergencyPhone, gender) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>姓名 : </td><td class='col2-wid'>" + name + "&nbsp;/&nbsp;" + telephone + "</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>人员类型：</td><td colspan='2'>" + personnelType + "</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>地址：</td><td colspan='2'>" + address + "</td></tr>";

    if ((emergencyPeople.length != 0) && (emergencyPhone.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>紧急联系人 : </td><td class='col2-wid'>" + emergencyPeople + "&nbsp;/&nbsp;" + emergencyPhone + "</td></tr>";
    }

    
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    var myIcon = new BMap.Icon("/infoManage/image/keyPerson.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
    myIcon.setImageSize(new BMap.Size(21, 26));
    marker = new BMap.Marker(point, {
      icon: myIcon,
      offset: new BMap.Size(0, -24)
    });


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }


    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#keyPersonBtn').on('click', function () {
      showOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      hideOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //keyPersonAddMarker end
  // 重点人员
  wallDoorAddMarker: function (orgName, no, personNum, address, latitude, longitude, emergencyPeople, emergencyPhone) {
    var point = new BMap.Point(longitude, latitude);
    // 拼接html字符串
    var sContent = "<div>"
    sContent += "<div style='padding: 4px;color: #666;min-width: 120px;'><div><table class='baidumap-tip-table'><tbody>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>地址：</td><td colspan='2'>" + address + "</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address1'></i>墙门内户数：</td><td colspan='2'>" + personNum + "</td></tr>";
    sContent += "<tr><td class='tit' ><i class='fa fa-charge-address2'></i>所属组织：</td><td colspan='2'>" + orgName + "</td></tr>";
    
    if ((emergencyPeople.length != 0) && (emergencyPhone.length != 0)) {
      sContent += "<tr><td class='tit'><i class='fa fa-user-md1'></i>紧急联系人 : </td><td class='col2-wid'>" + emergencyPeople + "&nbsp;/&nbsp;" + emergencyPhone + "</td></tr>";
    }

    
    sContent += "</tbody></table></div></div>";
    // var sContent = '<div>skksks</div>';
    // 自定义覆盖物
    function ComplexCustomOverlay(point) {
      this._point = point;
      this._no = no;
      this.no = null;
      this._status = status;
      this.status = null;
    }

    ComplexCustomOverlay.prototype = new BMap.Overlay();
    ComplexCustomOverlay.prototype.initialize = function (map) {
      this._map = map;
      var div = this._div = document.createElement("div");
      div.className = "active-alarm-pointer";
      div.style.position = "absolute";
      div.style.zIndex = BMap.Overlay.getZIndex(this._point.lat);

      div.onmouseover = function () {
        //
      }

      div.onmouseout = function () {
        //
      }
      map.getPanes().labelPane.appendChild(div);
      div.parentElement.style.zIndex = div.style.zIndex + 1; //Let ripple be below the icon
      return div;

    }
    ComplexCustomOverlay.prototype.draw = function () {
      var map = this._map;
      var pixel = map.pointToOverlayPixel(this._point);
      this._div.style.left = pixel.x - 40 - 8 + 'px';
      this._div.style.top = pixel.y - 40 + 20 + 'px';
    }

    ComplexCustomOverlay.prototype.getPosition = function () {
      return this._point;
    }

    //4、自定义覆盖物添加事件方法
    ComplexCustomOverlay.prototype.addEventListener = function (event, fun) {
      this._div['on' + event] = fun;
    }
    var marker = new BMap.Marker(new BMap.Point(point)); // 创建点
    var myIcon = new BMap.Icon("/infoManage/image/keyPerson.png", new BMap.Size(21, 26)); //,{anchor: new BMap.Size(0, -24)}
    myIcon.setImageSize(new BMap.Size(21, 26));
    marker = new BMap.Marker(point, {
      icon: myIcon,
      offset: new BMap.Size(0, -24)
    });


    marker.no = no;
    marker.status = status;
    map.addOverlay(marker);
    var infoWindow = new BMap.InfoWindow(sContent, {
      offset: {
        height: 0,
        width: -15
      }
    }, {
      setZIndex: 99999999999
    }); // 创建信息窗口对象
    //  			 markerNormalmHide()
    //5、 为自定义覆盖物添加点击事件

    marker.addEventListener('click', function (e) {

      //  			        地图信息框显示
      $('.BMap_pop').parent().show();
      $(".BMap_shadow").parent().show();
      map.openInfoWindow(infoWindow, point);

      $(".BMap_pop").parent().css("top", "-24px")
      $(".BMap_shadow").parent().css("top", "-24px")
      $(".BMap_pop>div").eq(7).html('<div class="map-triangle"><img src="/public/images/map/map-triangle-img.png" /></div>');
      //        		$(".BMap_pop>img").eq(0).replaceWith('<img src="/public/images/map/map-triangle-img.png" />');

    });

    if (localStorage.getItem('loginName') == 'hbjd') {
      hideOver();
    }

    function showOver() {
      marker.show();
    }

    //			覆盖物隐藏
    function hideOver() {
      marker.hide();
    }


    // 其他模态框定位
    $('#configurationModal .tableModal .tbodyList').on('click', '#devicePositionBtn', function () {
      var devicecode = $(this).parent().attr("devcode");
      //            hideOver();
      if (devicecode == no) {
        showOver();
      }
    });
    $('#dailyAlarmModal .tableModal tbody').on('click', '.positionPonitMap', function () {
      var devicecode = $(this).parent().attr("devcode");
      if (devicecode == no) {
        showOver();
      }
    });
    // 设备状态筛选
    $('#allDevBtn').on('click', function () {
      showOver();
    });
    $('#keyPersonBtn').on('click', function () {
      hideOver();
    }).siblings('.devBtn').on('click', function () {
      hideOver();
    });
    $('#earlyWarningBtn').on('click', function () {
      hideOver();
    });
    $('#wallDoorBtn').on('click', function () {
      showOver();
    });
    $('#fireStationBtn').on('click', function () {
      hideOver();
    });
    $('#houseMasterBtn').on('click', function () {
      hideOver();
    });
    $('.combinedActionBtn').on('click', function () {
      hideOver();
    });
    // 协同作战地图点位显示
    $('#combinedActionBtn').on('click', function () {
      hideOver();
    });
    $('#buildingBtn').on('click', function () {
      hideOver();
    });
    $('#wenbaoBtn').on('click', function () {
      hideOver();
    });
    $('#keepWatchBtn').on('click', function () {
      hideOver();
    });

    function removePoint() {
      map.removeOverlay(marker);
    }
    return {
      showOver: showOver,
      hideOver: hideOver,
      removePoint: removePoint,
      status: status,
      devCode: no,
      marker: marker
    }
    // 
  }, //wallDoorAddMarker end
  /**
   * 初始化地图
   * mapId 地图div的id
   * longitude 经度
   * latitude 纬度
   * zoom 地图比例大小
   */
  initialize: function (longitude, latitude, zoom) {
    // 百度地图API功能
    var point = BaiDuMap.point(longitude, latitude);
    var mapStyle = [{
        "featureType": "water",
        "elementType": "all",
        "stylers": {
          "color": "#17415eff"
        }
      },
      {
        "featureType": "road",
        "elementType": "geometry.fill",
        "stylers": {
          "color": "#354c64ff"
        }
      },
      {
        "featureType": "highway",
        "elementType": "geometry.stroke",
        "stylers": {
          "color": "#354c64ff"
        }
      },
      {
        "featureType": "arterial",
        "elementType": "geometry.fill",
        "stylers": {
          "color": "#354c64ff"
        }
      },
      {
        "featureType": "arterial",
        "elementType": "geometry.stroke",
        "stylers": {
          "color": "#354c64ff"
        }
      },
      {
        "featureType": "local",
        "elementType": "geometry",
        "stylers": {
          "color": "#354c64ff"
        }
      },
      {
        "featureType": "land",
        "elementType": "all",
        "stylers": {
          "color": "#112133ff"
        }
      },
      {
        "featureType": "railway",
        "elementType": "geometry.fill",
        "stylers": {
          "color": "#000000"
        }
      },
      {
        "featureType": "railway",
        "elementType": "geometry.stroke",
        "stylers": {
          "color": "#08304b"
        }
      },
      {
        "featureType": "subway",
        "elementType": "geometry",
        "stylers": {
          "lightness": -70
        }
      },
      {
        "featureType": "building",
        "elementType": "geometry.fill",
        "stylers": {
          "color": "#112233ff"
        }
      },
      {
        "featureType": "all",
        "elementType": "labels.text.fill",
        "stylers": {
          "color": "#857f7f"
        }
      },
      {
        "featureType": "all",
        "elementType": "labels.text.stroke",
        "stylers": {
          "color": "#000000"
        }
      },
      {
        "featureType": "building",
        "elementType": "geometry",
        "stylers": {
          "color": "#112233ff"
        }
      },
      {
        "featureType": "green",
        "elementType": "geometry",
        "stylers": {
          "color": "#0a2e22ff"
        }
      },
      {
        "featureType": "boundary",
        "elementType": "all",
        "stylers": {
          "color": "#1e1c1c"
        }
      },
      {
        "featureType": "manmade",
        "elementType": "geometry",
        "stylers": {
          "color": "#112233ff"
        }
      },
      {
        "featureType": "poi",
        "elementType": "all",
        "stylers": {
          "visibility": "off"
        }
      },
      {
        "featureType": "all",
        "elementType": "labels.icon",
        "stylers": {
          "visibility": "off"
        }
      },
      {
        "featureType": "all",
        "elementType": "labels.text.fill",
        "stylers": {
          "color": "#2da0c6",
          "visibility": "on"
        }
      }
    ]
    // var mapStyle = [{
    //   "featureType": "water",
    //   "elementType": "all",
    //   "stylers": {
    //     "color": "#000000ff",
    //     "lightness": 4
    //   }
    // }, {
    //   "featureType": "highway",
    //   "elementType": "geometry.fill",
    //   "stylers": {
    //     "color": "#1a232cff"
    //   }
    // }, {
    //   "featureType": "highway",
    //   "elementType": "geometry.stroke",
    //   "stylers": {
    //     "color": "#1a232cff"
    //   }
    // }, {
    //   "featureType": "arterial",
    //   "elementType": "geometry.fill",
    //   "stylers": {
    //     "color": "#4a4a4aff"
    //   }
    // }, {
    //   "featureType": "arterial",
    //   "elementType": "geometry.stroke",
    //   "stylers": {
    //     "color": "#1a232cff"
    //   }
    // }, {
    //   "featureType": "local",
    //   "elementType": "geometry",
    //   "stylers": {
    //     "color": "#1a232cff"
    //   }
    // }, {
    //   "featureType": "land",
    //   "elementType": "all",
    //   "stylers": {
    //     "color": "#1a232cff"
    //   }
    // }, {
    //   "featureType": "railway",
    //   "elementType": "geometry.fill",
    //   "stylers": {
    //     "color": "#000000ff"
    //   }
    // }, {
    //   "featureType": "railway",
    //   "elementType": "geometry.stroke",
    //   "stylers": {
    //     "color": "#1a232cff"
    //   }
    // }, {
    //   "featureType": "subway",
    //   "elementType": "geometry",
    //   "stylers": {
    //     "lightness": -92
    //   }
    // }, {
    //   "featureType": "building",
    //   "elementType": "geometry.fill",
    //   "stylers": {
    //     "color": "#27323aff"
    //   }
    // }, {
    //   "featureType": "all",
    //   "elementType": "labels.text.fill",
    //   "stylers": {
    //     "color": "#857f7f"
    //   }
    // }, {
    //   "featureType": "all",
    //   "elementType": "labels.text.stroke",
    //   "stylers": {
    //     "color": "#000000ff"
    //   }
    // }, {
    //   "featureType": "building",
    //   "elementType": "geometry",
    //   "stylers": {
    //     "color": "#27323aff"
    //   }
    // }, {
    //   "featureType": "green",
    //   "elementType": "geometry",
    //   "stylers": {
    //     "color": "#1a1e18ff",
    //     "lightness": -12
    //   }
    // }, {
    //   "featureType": "boundary",
    //   "elementType": "all",
    //   "stylers": {
    //     "color": "#27323aff"
    //   }
    // }, {
    //   "featureType": "manmade",
    //   "elementType": "geometry",
    //   "stylers": {
    //     "color": "#27323aff"
    //   }
    // }, {
    //   "featureType": "poi",
    //   "elementType": "labels.icon",
    //   "stylers": {
    //     "visibility": "off"
    //   }
    // }, {
    //   "featureType": "all",
    //   "elementType": "labels.icon",
    //   "stylers": {
    //     "visibility": "off"
    //   }
    // }, {
    //   "featureType": "all",
    //   "elementType": "labels.text.fill",
    //   "stylers": {
    //     "color": "#000000ff",
    //     "lightness": 35,
    //     "visibility": "on"
    //   }
    // }]

    // [{
    //     "featureType": "water",
    //     "elementType": "all",
    //     "stylers": {
    //       "color": "#000000ff",
    //       "lightness": 4
    //     }
    //   },
    //   {
    //     "featureType": "highway",
    //     "elementType": "geometry.fill",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "highway",
    //     "elementType": "geometry.stroke",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "arterial",
    //     "elementType": "geometry.fill",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "arterial",
    //     "elementType": "geometry.stroke",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "local",
    //     "elementType": "geometry",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "land",
    //     "elementType": "all",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "railway",
    //     "elementType": "geometry.fill",
    //     "stylers": {
    //       "color": "#000000ff"
    //     }
    //   },
    //   {
    //     "featureType": "railway",
    //     "elementType": "geometry.stroke",
    //     "stylers": {
    //       "color": "#1a232cff"
    //     }
    //   },
    //   {
    //     "featureType": "subway",
    //     "elementType": "geometry",
    //     "stylers": {
    //       "lightness": -92
    //     }
    //   },
    //   {
    //     "featureType": "building",
    //     "elementType": "geometry.fill",
    //     "stylers": {
    //       "color": "#27323aff"
    //     }
    //   },
    //   {
    //     "featureType": "all",
    //     "elementType": "labels.text.fill",
    //     "stylers": {
    //       "color": "#857f7f"
    //     }
    //   },
    //   {
    //     "featureType": "all",
    //     "elementType": "labels.text.stroke",
    //     "stylers": {
    //       "color": "#000000ff"
    //     }
    //   },
    //   {
    //     "featureType": "building",
    //     "elementType": "geometry",
    //     "stylers": {
    //       "color": "#27323aff"
    //     }
    //   },
    //   {
    //     "featureType": "green",
    //     "elementType": "geometry",
    //     "stylers": {
    //       "color": "#1a1e18ff",
    //       "lightness": -12
    //     }
    //   },
    //   {
    //     "featureType": "boundary",
    //     "elementType": "all",
    //     "stylers": {
    //       "color": "#27323aff"
    //     }
    //   },
    //   {
    //     "featureType": "manmade",
    //     "elementType": "geometry",
    //     "stylers": {
    //       "color": "#27323aff"
    //     }
    //   },
    //   {
    //     "featureType": "poi",
    //     "elementType": "labels.icon",
    //     "stylers": {
    //       "visibility": "off"
    //     }
    //   },
    //   {
    //     "featureType": "all",
    //     "elementType": "labels.icon",
    //     "stylers": {
    //       "visibility": "off"
    //     }
    //   },
    //   {
    //     "featureType": "all",
    //     "elementType": "labels.text.fill",
    //     "stylers": {
    //       "color": "#000000ff",
    //       "lightness": 35,
    //       "visibility": "on"
    //     }
    //   }
    // ]
    map.setMapStyle({
      styleJson: mapStyle
    });
    //   楼长制 地图上自定义创建多边形 
    var polyline = new BMap.Polyline([
      new BMap.Point(120.193387, 30.225032),
      new BMap.Point(120.194483, 30.22497),
      new BMap.Point(120.19566, 30.225578),
      new BMap.Point(120.19628, 30.226148),
      new BMap.Point(120.195885, 30.226577),
      new BMap.Point(120.195364, 30.227131),
      new BMap.Point(120.194358, 30.226382),
      new BMap.Point(120.19354, 30.225368),
      new BMap.Point(120.193217, 30.225282),
      new BMap.Point(120.192759, 30.225539),
      new BMap.Point(120.191842, 30.225578),
      new BMap.Point(120.191393, 30.225375),
      new BMap.Point(120.191142, 30.224985),
      new BMap.Point(120.191501, 30.224884),
      new BMap.Point(120.191959, 30.225251),
      new BMap.Point(120.192714, 30.224977),
      new BMap.Point(120.19292, 30.224736),
      new BMap.Point(120.193477, 30.224985),
      new BMap.Point(120.193387, 30.225032)
    ], {
      strokeColor: "#d5da13",
      strokeWeight: 2,
      strokeOpacity: 0.5
    }); //创建折线

    function add_overlay() {
      map.addOverlay(polyline); //增加多边形
    }
    //清除覆盖物
    function remove_overlay() {
      map.clearOverlays();
    }

    // add_overlay();
    map.centerAndZoom(point, zoom);
    //map.setZoom(zoom);
    map.enableScrollWheelZoom(true);
    //单击获取点击的经纬度
    map.addEventListener("click", function (e) {
      BaiDuMap.getLongLat(e.point.lng, e.point.lat);
    });
    //    	var b = new BMap.Bounds(new BMap.Point(115.838103,32.151624),new BMap.Point(124.871176,28.308826));
    //    	try {	
    //    		BMapLib.AreaRestriction.setBounds(map, b);
    //    	} catch (e) {
    //    		alert(e);
    //    	}
  },
  /**
   * 单个加点
   * longitude 经度
   * latitude 纬度
   * no 编号(唯一)
   * status 不传为默认图标
   */


  //		清除覆盖物
  removeOverlay: function () {
    map.clearOverlays();
  },

  /**
   * 移动地图
   * longitude 经度
   * latitude 纬度
   */
  panTo: function (longitude, latitude) {
    map.panTo(BaiDuMap.point(longitude, latitude));
    map.centerAndZoom(new BMap.Point(longitude, latitude));
    map.centerAndZoom(new BMap.Point(longitude, latitude));
    // 定位到中心点后将地图向下移动100px
    // setTimeout(function (){
    //   map.panBy(0,100);
    // },700);

  },
  /**
   *弹出菜单
   */
  popMenu: function (no) {
    var allOverlay = map.getOverlays();
    for (var i = 0; i < allOverlay.length; i++) {
      if (allOverlay[i].no == no) {
        allOverlay[i].V.click();
        break;
      }
    }

  },

  /**
   * 删除节点
   * no 编号(唯一)
   */
  deletePoint: function (no) {
    var allOverlay = map.getOverlays();
    var arrLength = allOverlay.length;
    for (var i = 0; i < arrLength; i++) {
      if (allOverlay[i].no == no) {
        map.removeOverlay(allOverlay[i]);
      }
    }
  },

  deletePointStatus: function (status) {
    var allOverlay = map.getOverlays();
    var arrLength = allOverlay.length;
    for (var i = 0; i < arrLength; i++) {
      if (allOverlay[i].status == status) {
        map.removeOverlay(allOverlay[i]);
      }
    }
  },
  /**
   * 获取点击的经纬度
   */
  getLongLat: function (longitude, latitude) {
    if (clickStatus) {
      winTip.alert("经度:" + longitude + ",纬度:" + latitude);
    }
  },
  /**
   * 允许点击
   */
  openClick: function () {
    clickStatus = true;
  },
  /**
   * 禁止点击
   */
  closeClick: function () {
    clickStatus = false;
  },
  test: function () {
    var myDate = new Date();
    winTip.alert("开始时间:" + myDate.toLocaleTimeString());
    var bounds = map.getBounds();
    var sw = bounds.getSouthWest();
    var ne = bounds.getNorthEast();
    var lngSpan = Math.abs(sw.lng - ne.lng);
    var latSpan = Math.abs(ne.lat - sw.lat);
    for (var i = 0; i < 500; i++) {
      var point1 = new BMap.Point(sw.lng + lngSpan * (Math.random() * 0.7), ne.lat - latSpan * (Math.random() * 0.7));
      BaiDuMap.addMarkerTime(point1, i, '设备' + i, '杭州市', '');
    }
    var myDate1 = new Date();
    winTip.alert("结束时间:" + myDate1.toLocaleTimeString());
  },


};